import random
import math

NUMBER = 10000000
numberOfHits = 0
for i in range(NUMBER):
    x = random.random()*2 - 1
    y = random.random()*2 - 1
    if x*x + y*y <=1:
        numberOfHits += 1
pi = 4*numberOfHits / NUMBER

print(math.pi - pi)